package com.winz.cultureapp.adapter.xrcv;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.mine.xrecyclerview.rcvadapter.BaseRcvAdapter;
import com.mine.xrecyclerview.rcvadapter.ViewHolder;
import com.winz.cultureapp.R;
import com.winz.cultureapp.entity.ProjectListBean;

import java.util.List;

/**
 * 项目资源库
 */

public class ProjectAdapter extends BaseRcvAdapter<ProjectListBean.DataBean.ListBean> {

    public ProjectAdapter(Context context, List<ProjectListBean.DataBean.ListBean> datas, int... resid) {
        super(context, datas, resid);
    }

    @Override
    public void convert(ViewHolder holder, ProjectListBean.DataBean.ListBean data, int itemViewType) {

    }

    @Override
    public void convert(int position, ViewHolder holder, ProjectListBean.DataBean.ListBean listBean, int itemViewType) {
        super.convert(position, holder, listBean, itemViewType);
        if (itemViewType != -1){
            holder.setText(R.id.tv_title,listBean.title);

            Glide.with(mContext)
                    .load(listBean.imageUrl)
                    .error(R.drawable.pic_default_h)
                    .into((ImageView) holder.getView(R.id.iv_pic));
        }


    }
}
